{
	template:`
	<a-page-header title="编辑" sub-title="外协登录信息">
		<template #extra>
			<a-button type="primary" @click="save();">保存</a-button>
			<m-back @click="back(false);">关闭</m-back>
		</template>
		<a-card :hoverable="true" :bodyStyle="{padding:'20px 20px 0'}">
			<a-form class="index-form" :wrapper-col="{span:24}">
				<a-row :gutter="10">
					<a-col :span="12">
						<a-form-item label="账号" class="index-form-item">
						    <span v-if="model.oid">{{model.username}}</span>
							<a-input v-else v-model:value="model.username" placeholder="请输入用户名"/>
						</a-form-item>
					</a-col>
					<a-col :span="12">
						<a-form-item label="真实姓名" class="index-form-item">
							<a-input v-model:value="model.realname" placeholder="请输入真实姓名"/>
						</a-form-item>
					</a-col>
					<a-col :span="12">
						<a-form-item label="密码" class="index-form-item">
							<a-input-password v-model:value="model.password" placeholder="请输入密码"/>
						</a-form-item>
					</a-col>
					<a-col :span="12">
						<a-form-item label="重复密码" class="index-form-item">
							<a-input-password v-model:value="password" placeholder="请再次输入密码"/>
						</a-form-item>
					</a-col>
					<a-col :span="12">
						<a-form-item label="登录机构" class="index-form-item">
							<a-select :options="orgGroups" v-model:value="model.orgGroup.oid" placeholder="请选择登录机构" show-search :filter-option="selectFilter"/>
						</a-form-item>
					</a-col>
					<a-col :span="12" style="padding-bottom:18px;">
						<a-alert message="不填写密码则不会修改原密码" type="info" />
					</a-col>
				</a-row>
			</a-form>
		</a-card>
	</a-page-header>
	`,
	props: ['localeZh','param','parentVue'],
	data:function(){
		return {
			model:{orgGroup:{}},
			password:'',
			orgGroups:[]
		};
	},
	mounted(){
		this.model=this.param.model;
		this.model.password='';
        this.requestData('action/manage/adminGroup/getMyOrgGroup',{},function(json){
            if(json.code==0){
                for(let i=0;i<json.list.length;i++){
                    let org=json.list[i];
                    this.orgGroups.push({label:org.parent.name+'/'+org.name,value:org.oid});
                }
            }
        }.bind(this));
	},
	methods:{
		save:function(){
			this.requestData('action/manage/adminAssist/doSave',
				{model:this.model,password:this.password},
				data=>{
					if(!data.code){
						this.remind().success(data.msg);
						this.back(true);
					}else{
						this.remind().error(data.msg);
					}
				}
			);
		},
	}
}